package f.h.dragon.patterns.mapper;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

import javax.sql.DataSource;

import junit.framework.TestCase;

/**
 * MessageGateWayTester: test
 *
 * @author Wenlong Meng(wenlong.meng@gmail.com)
 * @version 1.0 at 2012/04/23
 * @since 1.0
 */
public class DataMapperTester extends TestCase {
	
	//local variables
	/**
	 * data source
	 */
	private JdbcTemplate jdbcTemplate;
	
	//test
	/**
	 * test null arg
	 */
	public void testPersonDataMapper(){
		String sql = "";
		List<Person> persons = this.jdbcTemplate.queryForList(sql, new PersonDataMapper());
		assertEquals(0, persons.size());
	}

	/**
	 * init resource
	 * 
	 * @see junit.framework.TestCase#setUp()
	 */
	@Override
	protected void setUp() throws Exception {
		super.setUp();
		this.jdbcTemplate = new JdbcTemplate(null);
	}

	/**
	 * release resource
	 * 
	 * @see junit.framework.TestCase#tearDown()
	 */
	@Override
	protected void tearDown() throws Exception {
		super.tearDown();
	}

}
